package com.xinqi.modules.exam.student.controller.inner;

import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.exam.student.client.CourseExamPaperStudentClient;
import com.xinqi.modules.exam.student.dto.req.CourseExamPaperStudentBatchDelDTO;
import com.xinqi.modules.exam.student.dto.req.CourseExamPaperStudentQueryDTO;
import com.xinqi.modules.exam.student.dto.rsp.CourseExamPaperStudentResultDTO;
import com.xinqi.modules.exam.student.service.CourseExamPaperStudentService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.RestController;


/**
 * 课程测评学生答题内部控制层
 *
 * @author: linkai
 * @date: 2023/07/02
 */
@Hidden
@Primary
@RestController
@RequiredArgsConstructor
public class CourseExamPaperStudentInnerController implements CourseExamPaperStudentClient {
    private final CourseExamPaperStudentService courseExamPaperStudentService;

    @Override
    public R<PageInfo<CourseExamPaperStudentResultDTO>> page(CourseExamPaperStudentQueryDTO dto) {
        PageInfo<CourseExamPaperStudentResultDTO> page = courseExamPaperStudentService.page(dto, dto);
        return R.data(page);
    }

    @Override
    public R<CourseExamPaperStudentResultDTO> findById(Long id) {
        CourseExamPaperStudentResultDTO dto = courseExamPaperStudentService.findById(id);
        return R.data(dto);
    }

    @Override
    public R<Boolean> batchDelUser(CourseExamPaperStudentBatchDelDTO dto) {
        return R.data(courseExamPaperStudentService.batchDelUser(dto));
    }
}
